package com.xbongbong.sso.model.impl;

import com.xbongbong.sso.domain.dao.OauthUserDao;
import com.xbongbong.sso.domain.entity.OauthUserEntity;
import com.xbongbong.sso.model.OauthUserModel;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author bomfish
 */
@Service("oauthUserModel")
public class OauthUserModelImpl implements OauthUserModel {
    @Resource
    private OauthUserDao oauthUserDao;

    @Override
    public Long insert(OauthUserEntity entity) {
        return oauthUserDao.insert(entity);
    }

    @Override
    public void insertBatch(List<OauthUserEntity> list) {
        oauthUserDao.insertBatch(list);
    }

    @Override
    public List<OauthUserEntity> findEntities(Map<String, Object> param) {
        return oauthUserDao.findEntities(param);
    }

    @Override
    public Integer getEntityCount(Map<String, Object> param) {
        return oauthUserDao.getEntitiesCount(param);
    }

    @Override
    public void update(OauthUserEntity entity) {
        oauthUserDao.update(entity);
    }

    @Override
    public OauthUserEntity getByKey(Long key, String corpid) {
        return oauthUserDao.getByKey(key, corpid);
    }

    @Override
    public OauthUserEntity getByUserId(String userId, String corpid) {
        return oauthUserDao.getByUserId(userId, corpid);
    }

    @Override
    public OauthUserEntity getByCode(String corpid, String code) {
        return oauthUserDao.getByCode(corpid, code);
    }
}
